package com.woniu.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniu.dao.AdvancenoticeMapper;
import com.woniu.pojo.Advancenotice;
import com.woniu.service.AdvancenoticeService;
@Service
@Transactional
public class AdvancenoticeServiceImpl implements AdvancenoticeService {
	@Autowired
	public AdvancenoticeMapper advancenoticeMapper;
	@Override
	public Advancenotice selectAdvancenoticeByhId(String hid) {
		// TODO Auto-generated method stub
		Advancenotice advancenotice = advancenoticeMapper.selectAdvancenoticeByhId(hid);
		return advancenotice;
	}
	@Override
	public int addAdvancenotice(Advancenotice advancenotice) {
		// TODO Auto-generated method stub
		String advanceNotice_id="C"+advancenotice.getH_id();
		advancenotice.setAdvanceNotice_id(advanceNotice_id);
		int advancenotice2 = advancenoticeMapper.addAdvancenotice(advancenotice);
		return advancenotice2;
	}
	@Override
	public int updateAdvancenotice(Advancenotice advancenotice) {
		// TODO Auto-generated method stub
		int rowCount = advancenoticeMapper.updateAdvancenotice(advancenotice);
		return rowCount;
	}

}
